package com.aaa.service.front.Impl;

import com.aaa.entity.ShippingAddress;
import com.aaa.mapper.front.FrontUserAddressMapper;
import com.aaa.service.front.IFrontUserAddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FrontUserAddressServiceImpl implements IFrontUserAddressService{
    @Resource
    private FrontUserAddressMapper frontUserAddressMapper;

    @Override
    public List<ShippingAddress> listByAddress1(Integer UserInfoId) {
        return frontUserAddressMapper.findAllByAddress1(UserInfoId);
    }

    @Override
    public List<ShippingAddress> listByAddress(Integer UserInfoId) {
        return frontUserAddressMapper.findAllByAddress(UserInfoId);
    }

    @Override
    public ShippingAddress findByShippingAddressId(Integer shippingAddressId) {
        return frontUserAddressMapper.findByShippingAddressId(shippingAddressId);
    }

    @Override
    public int updateAddress(ShippingAddress shippingAddress) {
        return frontUserAddressMapper.doUpdateAddress(shippingAddress);
    }

    @Override
    public int addAddress(ShippingAddress shippingAddress) {
        return frontUserAddressMapper.doAddAddress(shippingAddress);
    }

    @Override
    public int deleteAddress(Integer shippingAddressId) {
        return frontUserAddressMapper.doDeleteAddress(shippingAddressId);
    }
}
